home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
clang
/
tcplusx.zip
/
DEVICE.H
< prev
next >
Wrap
C/C++ Source or Header
|
1991-02-28
|
4KB
|
149 lines
#ifndef _DEVICE_H
#define _DEVICE_H
//
// device.h - header file for class Device
// Author - Robin W. McKean
// Last Update - February 19,1991
// Copyright (C) 1991 All rights reserved
//
// This file remains the property of the author, Robin W. McKean. You are
// free to use and change it as you see fit. This module, nor its object
// code, may not however be included in any packaged software without the
// written consent of the author.
//
// Contents ----------------------------------------------------------------
//
// deviceClass
// Device
//
// Description
//
// Defines the class Device. The purpose of this class is to serve
// as an abstract class from which other devices can be built.
//
// End ---------------------------------------------------------------------
// Interface dependencies ---------------------------------------------------
#ifndef _IOSTREAM_H
#include <iostream.h>
#endif
#ifndef _GEN_H
#include <gen.h>
#endif
#ifndef _USETYPES_H
#include <usetypes.h>
#endif
#ifndef _OBJECT_H
#include <object.h>
#endif
#ifndef _EVENT_H
#include <event.h>
#endif
// End Interface dependencies ---------------------------------------------
// Implementation dependencies --------------------------------------------
#ifndef _EVENTMGR_H
#include <eventmgr.h>
#endif
// End Implementation dependencies ----------------------------------------
// Class //
class Device : public Object
{
public:
Device( int initStatus = D_ON );
Device( Device& );
~Device( void ) {}
classType isA( ) const = 0;
char *nameOf( ) const = 0;
hashValueType hashValue( ) const;
int isEqual( const Object& ) const;
void printOn( ostream& ) const;
virtual int processA( Event& ) = 0;
virtual void pollDevice( ) = 0;
int status;
int type;
EventManager *theEventManager;
};
// Description --------------------------------------------------------------
//
// Defines the device class that will be used to gather input information
// and transform them into class Events for passing to various objects.
// This object cannot work without the event manager
//
// Constructor
//
// Device( int initStatus = D_ON )
//
// Initializes the device, and determines its initial status
//
// Device( Device& )
//
// Copy constructor, copies one device into another
//
// Destructor
//
// ~Device()
//
// Really serves no purpose, required by compiler
//
// Member Functions
//
// isA( )
//
// Returns character class type deviceClass
//
// nameOf( )
//
// Returns a character representation of class, "Device"
//
// hashValue( )
//
// This device has no hash value, so it returns 0
//
// isEqual( const Object& )
//
// Determines if one device is equal to another
//
// printOn( ostream& )
//
// Prints the contents of the class in a logical fashion
//
// processA( Event& )
//
// Responsible for taking an event, and processing the contents if
// applicable to this device
//
// pollDevice( )
//
// Requests information from a device, and translated into an event
// which is fed directly into the event manager's queue.
//
// Inherited Members
//
// isSortable( ) inherited from Object
// isAssociation( ) inherited from Object
// operator new inherited from Object
// firstThat( ) inherited from Object
// lastThat( ) inherited from Object
//
// End Description ----------------------------------------------------------
#endif // _DEVICE_H //